package xzx;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import xzx.mcp.tool.*;

/**
 * @ClassName Application
 * @Author xzx
 * @Version 1.0
 * @Description Application
 **/
@MapperScan("xzx.mapper")
@SpringBootApplication
public class McpServerApplication {

//    http://localhost:9060/sse

    public static void main(String[] args) {
        SpringApplication.run(McpServerApplication.class, args);
        System.out.println("------------MCP Server 启动成功--------------------");
    }

    /**
     * 注册MCP工具
     */
    @Bean
    public ToolCallbackProvider registMCPTools(DateTool dateTool, EmailTool emailTool, ProductTool productTool, VehicleInfoTool vehicleInfoTool, StatsTool statsTool) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(dateTool, emailTool, productTool,vehicleInfoTool,statsTool)
                .build();
    }

}
